<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" buffer="1000kb" isELIgnored="false" %>
	
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String contextPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redis监控</title>
<link href="<%=contextPath%>/static/css/content-base.css"
	rel="stylesheet" />
<link href="<%=contextPath%>/static/css/jquery/jquery-confirm.min.css"
	rel="stylesheet" />	 
<link href="<%=contextPath%>/static/css/bootstrap/bootstrap.css"
	rel="stylesheet" />	
</head>
<body class="gray-bg">

    <input id="address" type="hidden" value="${address }">
	<div class="wrapper wrapper-content">
		<div class="row">
			<div class="col-sm-4">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>CPU 使用详情:</h5>
					</div>
					<div class="ibox-content">
						<div id="cpu"></div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>Memory 使用详情:</h5>
					</div>
					<div class="ibox-content">
						<div id="memory"></div>
					</div>
					
				</div>
			</div>
			<div class="col-sm-4">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>每秒命中率:</h5>
					</div>
					<div class="ibox-content">
						<div id="command"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h3>Redis INFO：</h3>
					</div>
					<div class="ibox-content">
						<table class="table table-condensed table-hover"
							style="word-break: break-all; word-wrap: break-all;">
							<tr class="info">
							    <th>版本号</th>
                                <th>时间</th>
                                <th>角色</th>
                                <th>用户占用cpu%</th>
                                <th>内核占用cpu%</th>
                                <th>客户端连接数</th>
                                <th>拒绝连接数</th>
                                <th>使用总内存</th>
                                <th>使用物理内存</th>
                                <th>内存消耗峰值</th>
                               <!--  <th>新创建连接个数</th>
                                <th>拒绝的连接个数</th> -->
                                <th>key的总数量</th>
                                <th>每秒执行命令数</th>
                                <th>每秒过期key数量</th>
                                <th>每秒淘汰key数量</th>
                                <th>每秒命中数量</th>
                                <th>每秒丢失数量</th>
                                <!-- <th>AOF日志当前大小</th>
                                <th>是否开启cluster</th> -->
                            </tr>
							<tr class="info">
							    <th>rv</th>
                                <th>time</th>
                                <th>role</th>
                                <th>us</th>
                                <th>sy</th>
                                <th>cl</th>
                                <th>bcl</th>
                                <th>mem</th>
                                <th>rss</th>
                                <th>umph</th>
                                <!-- <th>tcr</th>
                                <th>rc</th> -->
                                <th>keys</th>
                                <th>cmd/s</th>
                                <th>exp/s</th>
                                <th>evt/s</th>
                                <th>hit/s</th>
                                <th>mis/s</th>
                                <!-- <th>aofcs</th>
                                <th>ce</th> -->
                              </tr>
							<tbody>
							    <%-- <c:forEach items="${infoList}" var="info" varStatus="vs"> --%>
									<tr>
										<td><span style="color:#FF7F00;font-weight:bold">${info.rv}</span> </td>
										<td><span style="font-weight:bold">${info.time}</span></td>
										<td><span style="color:#9ACD32;font-weight:bold">${info.role}</span></td>
										<td><span style="color:#FF7F00;font-weight:bold">${info.us}</span></td>
										<td><span style="color:#FF7F00;font-weight:bold">${info.sy}</span></td>
										<td><span style="color:#00CD00;font-weight:bold">${info.cl}</span></td>
										<td><span style="color:#EE0000;font-weight:bold">${info.bcl}</span></td>
										<td><span style="color:#00CD00;font-weight:bold">${info.mem}</span></td>
										<td><span style="color:#00CD00;font-weight:bold">${info.rss}</span></td>
										<td><span style="color:#00CD00;font-weight:bold">${info.umph}</span></td>
										<%-- <td>${info.tcr}</td>
										<td>${info.rc}</td> --%>
										<td><span style="font-weight:bold">${info.keys}</span></td>
										<td><span style="color:#00CD00;font-weight:bold">${info.cmd}</span></td>
										<td><span style="color:#EE0000;font-weight:bold">${info.exp}</span></td>
										<td><span style="color:#EE0000;font-weight:bold">${info.evt}</span></td>
										<td><span style="color:#D15FEE;font-weight:bold">${info.hit}</span></td>
										<td><span style="color:#D15FEE;font-weight:bold">${info.mis}</span></td>
										<%-- <td>${info.aofcs}</td> --%>
										<%-- <td>${info.ce}</td> --%>
									</tr>
								<%-- </c:forEach> --%>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title ">
					    <div class="col-sm-11">
							<h3>Redis实时日志(共${logLen}条)：</h3>
						</div>
						
						<div class="ibox-tools col-sm-1">
							<button type="button" onclick="empty();"
								class="btn btn-warning btn-xs " style=" float:right">清空日志</button>
						</div>
					</div>
					<div class="ibox-content">
						<table class="table table-condensed table-hover">
							<tbody>
								<c:forEach var="log" items="${logList }">
									<tr>
										<td>${log.id }</td>
										<td>${log.executeTime }</td>
										<td>${log.usedTime }</td>
										<td><p style="width: 600px; word-wrap: break-word; word-break: normal;">${log.args }</p></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	
</body>
<script src="<%=contextPath%>/static/js/jquery/jquery-3.1.1.min.js"></script>
<script src="<%=contextPath%>/static/js/jquery/jquery-confirm.min.js"></script>
<script src="<%=contextPath%>/static/js/highcharts/highcharts.js"></script>
<script src="<%=contextPath%>/static/js/redisMonitor/redisMonitor.js"></script>
</html>
<!-- <script type="text/javascript">
$("#updatePermission").click(function(){
	$.post("/updatePermission", {}, function(result) {
		if (result == "true") {
			alert("权限更新成功！！");
		}
	});
});
</script> -->
